Summary of alternative line break methods in PHP
PHP replaces the line break method summary, PHP has three ways to solve.1. Use Str_replace to replace line breaks
$str =str_replace (Array ("\ r \ n", "\ r", "\ n"), "", $str);
2. Use regular
PHP in the form input box to replace the return of some of the methods summarized, a friend who needs to refer to this article.
The code is as follows
Copy Code
? $str = "This is a test n";$patten = Array ("RN", "n"
If a line break exists in the content of a column of the database in the excel file exported by php, it is replaced by multiple lines in the excel file. how can this problem be solved? If a line break exists in the content of a column of the
1. The following example can remove extra blank space. The code is as follows:Copy code $ Str = "This line containstliberal rn use of whitespace. nn ";// First remove the leading/trailing whitespace// Remove the start and end blank www.111cn.net$
This article provides a detailed analysis of the PHP bounce loop method and the differences between continue, break, and exit. For more information, see
This article provides a detailed analysis of the PHP bounce loop method and the differences
When reading the manual, I found the PHP_EOL variable and checked the information, it turns out to be equivalent to line breaks in unix series \ n in windows series \ r \ n in mac \ rPHP can be replaced with PHP_EOL to improve the source code
The Linux shell can be user-defined functions and can be called casually in shell scripts.
The functions in the shell are defined in the following format:
[Function] funname [()]
{
action;
[return int;]
}
Description
1, can be with function fun
From:http://www.cnblogs.com/siqi/archive/2012/10/12/2720713.html // php there are three ways to resolve//1, use Str_replace to replace line breaks $str = str_replace (array ("\ r \ n", "\ r", "\ n"), "", $str ); // $str = preg_replace ('/
PHP uses the echo syntax to generate a blank line to the output long string. Q: What should I do if I use the echo method in php to output long strings to the webpage to generate empty rows? dutyList [2] [newArray (Instructor, 9), newArray
/**************** By Jiangong sun ******************* ***/
\ T horizontal Tab
\ ", \ ', \ Special characters
\ N is a line feed, linefeed in English, and 0xa in ASCII code\ R is the carriage return, carriage return in English, and ASCII code is 0xd
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.